/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 容器样式 */
.container {
    max-width: 800px;
    width: 90%;
    margin: 20px auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 主内容区域 */
main {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* 模式选择器 */
.mode-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 12px 24px;
    border: 2px solid #e1e8ed;
    background: white;
    color: #555;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
    transform: translateY(-2px);
}

.mode-btn.active.work {
    background: #ff6b6b;
    color: white;
    border-color: #ff6b6b;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.mode-btn.active.short-break {
    background: #48dbfb;
    color: white;
    border-color: #48dbfb;
    box-shadow: 0 4px 12px rgba(72, 219, 251, 0.4);
}

.mode-btn.active.long-break {
    background: #10ac84;
    color: white;
    border-color: #10ac84;
    box-shadow: 0 4px 12px rgba(16, 172, 132, 0.4);
}

/* 时钟容器 */
.timer-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

/* 进度环 */
.progress-ring {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.svg-ring {
    transform: rotate(-90deg);
}

.bg-ring {
    transition: stroke 0.3s ease;
}

.progress-bar {
    transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

/* 计时器显示 */
.timer-display {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.time-left {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.work .time-left {
    color: #ff6b6b;
}

.short-break .time-left {
    color: #48dbfb;
}

.long-break .time-left {
    color: #10ac84;
}

.current-mode {
    font-size: 1.2rem;
    color: #7f8c8d;
    font-weight: 500;
}

/* 控制按钮 */
.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.control-btn.primary {
    background: #ff6b6b;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.control-btn.primary:hover {
    background: #ee5253;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.control-btn:not(.primary) {
    background: #ecf0f1;
    color: #2c3e50;
}

.control-btn:not(.primary):hover:not(:disabled) {
    background: #bdc3c7;
    transform: translateY(-2px);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 统计部分 */
.stats-section {
    margin-bottom: 40px;
}

.stats-section h3 {
    text-align: center;
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ff6b6b;
    margin-bottom: 5px;
}

.stat-label {
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 设置部分 */
.settings {
    border-top: 1px solid #ecf0f1;
    padding-top: 30px;
}

.settings h3 {
    text-align: center;
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 20px;
}

.setting-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.setting-group label {
    font-size: 0.95rem;
    color: #34495e;
    font-weight: 500;
}

.setting-group input[type="number"] {
    width: 80px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

.setting-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.apply-btn {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.apply-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* 底部样式 */
footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main {
    animation: fadeIn 0.5s ease-out;
}

/* 脉动动画 - 用于即将结束提醒 */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 1s infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .progress-ring {
        width: 250px;
        height: 250px;
    }
    
    .svg-ring {
        width: 250px;
        height: 250px;
    }
    
    .time-left {
        font-size: 3rem;
    }
    
    .mode-selector {
        flex-direction: column;
        align-items: center;
    }
    
    .mode-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-btn {
        width: 100%;
        max-width: 200px;
    }
    
    .setting-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .setting-group input[type="number"] {
        width: 100%;
    }
}